<? $this->render('header') ?>
<h4>上传文件列表</h4>
<h5 style="color:red">上传目录：</h5>
<?=$config->basePath?>
<p><table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <th height="30" bgcolor="#EEEEEE">文件名</th>
    <th height="30" bgcolor="#EEEEEE">缩略图 (width:100px)</th>
    <th height="30" bgcolor="#EEEEEE">&nbsp;</th>
  </tr>
  <? foreach ($files as $file) { ?>
  <tr>
    <td bgcolor="#FFFFFF"><?=$file?>&nbsp;</td>
    <td bgcolor="#FFFFFF"><? if (preg_match('/\.(jpg|jpeg|bmp|png)$/i', $file)) { ?><img src="<?=$this->thumb(str_replace(EGP_WEB_DIR, '', $config->basePath) . "/$file", 100)?>" /><? } ?>&nbsp;</td>
    <td bgcolor="#FFFFFF"><a href="<?=$this->url(array('controller' => 'file', 'action' => 'download', 'filename' => urlencode($file)), true)?>">下载</a>&nbsp;<a href="<?=$this->url(array('controller' => 'file', 'action' => 'delete', 'filename' => urlencode($file)), true)?>">删除</a></td>
  </tr>
  <? } ?>
</table></p>
<p><a href="<?=$this->url(array('controller' => 'example', 'action' => 'index'), true)?>">返回示例首页</a></p>
<? $this->render('footer') ?>